//引入express模块
const express = require('express');
//引入连接池模块
const pool = require('../pool');
//创建路由器对象
const r = express.Router();


r.post("/h",(req,res)=>{
    var obj = req.body;
    console.log(obj);
    var sql = "insert into health_code(pic,htime,hc_uid,hc_tcid) values(?,?,?,?)";
    pool.query(sql,[obj.pic,obj.htime,obj.hc_uid,obj.hc_tcid],(err,result)=>{
        if(err) throw err;
        if(result.affectedRows>0){
            res.send({
                code: 200,
                magess: "成功"
            });
        }
    });
})


//导出路由器对象
module.exports = r;